<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>求和案例</title>
		
	</head>
	<body>
		<input type="text"  id="Va" placeholder="a" />
		<input type="text"  id="Vb" placeholder="b" />
		<button type="button"  id="btn">求和</button>
		<!-- <p id="show"></p> -->
		<script type="text/javascript">
			var a=Va.value;
			var b=Vb.value;
			function sum(a,b){
				alert(a+b);
			}
			btn.onclick=function(){
				sum(parseInt(Va.value),parseInt(Vb.value))
			}
			// document.getElementById("show").innerText=sum(a,b);
		</script>
	</body>
</html>
